+2005-09-02 Tor Lillqvist <tml@novell.com>
+
+ * gdk/win32/gdkevents-win32.c (gdk_event_translate): Keep track of
+ cursor position also in root window coordinates. Prune out
+ superfluous WM_MOUSEMOVE events even earlier, based on root window
+ coordinates. Windows sends WM_MOUSEMOVE messages after a new
+ window has ben mapped below the cursor even if the mouse doesn't
+ move. We used to generate GDK_MOTION_NOTIFY in these cases. This
+ confused at least gtk_menu_motion_notify(). (#314995)
+
+ * gtk/gtkintl.h: No need to include config.h here. It caused
+ warnings about GTK_LOCALEDIR being redefined on Win32 when
+ compiling files where gtkintl.h is included after gtkprivate.h
+ (which #undefines and re-#defines GTK_LOCALEDIR on Win32).
+
+ * gtk/gtkplug.c: Include config.h.
+
2005-09-01 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilesystemunix.c: Pass statbufs down to
+2005-09-02 Tor Lillqvist <tml@novell.com>
+
+ * gdk/win32/gdkevents-win32.c (gdk_event_translate): Keep track of
+ cursor position also in root window coordinates. Prune out
+ superfluous WM_MOUSEMOVE events even earlier, based on root window
+ coordinates. Windows sends WM_MOUSEMOVE messages after a new
+ window has ben mapped below the cursor even if the mouse doesn't
+ move. We used to generate GDK_MOTION_NOTIFY in these cases. This
+ confused at least gtk_menu_motion_notify(). (#314995)
+
+ * gtk/gtkintl.h: No need to include config.h here. It caused
+ warnings about GTK_LOCALEDIR being redefined on Win32 when
+ compiling files where gtkintl.h is included after gtkprivate.h
+ (which #undefines and re-#defines GTK_LOCALEDIR on Win32).
+
+ * gtk/gtkplug.c: Include config.h.
+
2005-09-01 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilesystemunix.c: Pass statbufs down to
static GdkWindow *current_window = NULL;
static gint current_x, current_y;
+static gint current_root_x, current_root_y;
static UINT msh_mousewheel;
static UINT client_message;
msg->wParam,
GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam)));
+ /* If we haven't moved, don't create any GDK event. Windows
+ * sends WM_MOUSEMOVE messages after a new window is shows under
+ * the mouse, even if the mouse hasn't moved. This disturbs gtk.
+ */
+ if (msg->pt.x + _gdk_offset_x == current_root_x &&
+ msg->pt.y + _gdk_offset_y == current_root_y)
+ break;
+
+ current_root_x = msg->pt.x + _gdk_offset_x;
+ current_root_y = msg->pt.y + _gdk_offset_y;
+
assign_object (&window, find_window_for_mouse_event (window, msg));
if (p_grab_window != NULL)
if (window != orig_window)
translate_mouse_coords (orig_window, window, msg);
- /* If we haven't moved, don't create any event.
- * Windows sends WM_MOUSEMOVE messages after button presses
- * even if the mouse doesn't move. This disturbs gtk.
- */
- if (window == current_window &&
- GET_X_LPARAM (msg->lParam) == current_x &&
- GET_Y_LPARAM (msg->lParam) == current_y)
- break;
-
event = gdk_event_new (GDK_MOTION_NOTIFY);
event->motion.window = window;
event->motion.time = _gdk_win32_get_next_tick (msg->time);
_gdk_windowing_window_get_offsets (window, &xoffset, &yoffset);
event->motion.x += xoffset;
event->motion.y += yoffset;
- event->motion.x_root = msg->pt.x + _gdk_offset_x;
- event->motion.y_root = msg->pt.y + _gdk_offset_y;
+ event->motion.x_root = current_root_x;
+ event->motion.y_root = current_root_y;
event->motion.axes = NULL;
event->motion.state = build_pointer_event_state (msg);
event->motion.is_hint = FALSE;